package practise.hibernate.persistence;

import org.hibernate.annotations.AccessType;
import practise.hibernate.interceptor.LogInterceptor;

import javax.persistence.*;

@Embeddable
@EntityListeners(LogInterceptor.class)
public class PersonName {
    @Column(name = "firstName")
    private String firstName ;
    @Column(name = "lastName")
    private String lastName;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    @Override
    public String toString() {
        return "Name{" +
                "firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                '}';
    }
}
